<?php


/**
 * Use the DS to separate the directories in other defines
 */
if (!defined('DS')) {
  define('DS', DIRECTORY_SEPARATOR);
}

/**
 * The full path to the directory which holds "app", WITHOUT a trailing DS.
 *
 */
if (!defined('ROOT')) {
  define('ROOT', dirname(dirname(dirname(__FILE__))) );
}
/**
 * The actual directory name for the "app".
 *
 */
if (!defined('APP_DIR')) {
  define('APP_DIR', 'engrain');
}
/**
 * The absolute path to the "cake" directory, WITHOUT a trailing DS.
 *
 */
if (!defined('CAKE_CORE_INCLUDE_PATH')) {
  define('CAKE_CORE_INCLUDE_PATH', dirname(ROOT).DS.'cake');
}

if (!defined('WEBROOT_DIR')) {
  define('WEBROOT_DIR', 'test');
}
if (!defined('WWW_ROOT')) {
  define('WWW_ROOT', dirname(dirname(ROOT)));
}

#print('<pre>');
#print('FILE       :'.__FILE__.PHP_EOL);
#print('ROOT       :'.ROOT.PHP_EOL);
#print('APP_DIR    :'.APP_DIR.PHP_EOL);
#print('WEBROOT_DIR:'.WEBROOT_DIR.PHP_EOL);
#print('WWW_ROOT   :'.WWW_ROOT.PHP_EOL);
#print('</pre>');


/**
 * Editing below this line should NOT be necessary.
 * Change at your own risk.
 *
 */
	if (!defined('CORE_PATH')) {
		if (function_exists('ini_set') && ini_set('include_path', CAKE_CORE_INCLUDE_PATH . PATH_SEPARATOR . ROOT . DS . APP_DIR . DS . PATH_SEPARATOR . ini_get('include_path'))) {
			define('APP_PATH', null);
			define('CORE_PATH', null);
		} else {
			define('APP_PATH', ROOT . DS . APP_DIR . DS);
			define('CORE_PATH', CAKE_CORE_INCLUDE_PATH . DS);
		}
	}
	if (!include(CORE_PATH . 'cake' . DS . 'bootstrap.php')) {
		trigger_error("CakePHP core could not be found.  Check the value of CAKE_CORE_INCLUDE_PATH in APP/webroot/index.php.  It should point to the directory containing your " . DS . "cake core directory and your " . DS . "vendors root directory.", E_USER_ERROR);
	}
	if (isset($_GET['url']) && $_GET['url'] === 'favicon.ico') {
		return;
	} else {
		$Dispatcher = new Dispatcher();
		$Dispatcher->dispatch($url);
	}
	if (Configure::read() > 0) {
		echo "<!-- " . round(getMicrotime() - $TIME_START, 4) . "s -->";
	}
?>